import { reqGetSearchInfo } from "@/api";
const state = {
  searchlist: {},
};
const actions = {
  async getSearchList({ commit }, params = {}) {
    let result = await reqGetSearchInfo(params);
    console.log("searchlist", result);
    if (result.code === 200) {
      commit("GETSEARCHLIST", result.data);
    }
  },
};
const mutations = {
  GETSEARCHLIST(state, searchlist) {
    state.searchlist = searchlist;
  },
};
const getters = {
  goodsList: (state) => state.searchlist.goodsList || [],
  attrsList: (state) => state.searchlist.attrsList || [],
  trademarkList: (state) => state.searchlist.trademarkList || [],
};
export default {
  state,
  actions,
  mutations,
  getters,
};
